package api

import "fx_swift_ifcgate/pkg/validator"

type Bean struct {
	JsonEnc    string `json:"jsonEnc"`
	KeyEnc     string `json:"keyEnc"`
	Sign       string `json:"sign"`
	MerchantNo string `json:"merchantNo"`
}

type JsonStr struct {
	Head HeadStr `json:"head"`
	//Body BodyStr `json:"body"`
}

type BodyStr struct {
	BuyAmount    string `json:"buyAmount"`
	BuyCurrency  string `json:"buyCurrency"`
	ExpireTime   int64  `json:"expireTime"`
	MerOrderNo   string `json:"merOrderNo"`
	QuoteId      int64  `json:"quoteId"`
	Rate         string `json:"rate"`
	SellAmount   string `json:"sellAmount"`
	SellCurrency string `json:"sellCurrency"`
}

type HeadStr struct {
	Language  string `json:"language"`
	TradeCode string `json:"tradeCode"`
	TradeTime int64  `json:"tradeTime"`
	TradeType string `json:"tradeType"`
	Version   string `json:"version"`
	RespDesc  string `json:"respDesc"`
	RespCode  string `json:"respCode"`
}

type TestReq struct {
	LockDirection string `json:"lockDirection"`
	BuyCurrency   string `json:"buyCurrency"`
	MerOrderNo    string `json:"merOrderNo"`
	Amount        string `json:"amount"`
	SellCurrency  string `json:"sellCurrency"`
}

type PayeePostTp3005Req struct {
	CountryCode    string `json:"countryCode" binding:"required"`
	ArriveCurrency string `json:"arriveCurrency" binding:"required"`
	DebitCurrency  string `json:"debitCurrency" binding:"required"`
	PayType        string `json:"payType" binding:"required"`
}

func (req PayeePostTp3005Req) GetMessage() validator.ValidatorMessages {
	return validator.ValidatorMessages{
		"CountryCode.required":    "CountryCode不能为空",
		"ArriveCurrency.required": "ArriveCurrency不能为空",
		"DebitCurrency.required":  "DebitCurrency不能为空",
		"PayType.required":        "PayType不能为空",
	}
}

type PayeePostTp3005Res struct {
	ResHead           HeadStr       `json:"head"`
	AutoGeneratedBody AutoGenerated `json:"body"`
}

type BankAcctType struct {
	Num01 []string `json:"01"`
}
type Condition struct {
	BankAcctType BankAcctType `json:"bankAcctType"`
}
type Payee struct {
	Optional []string `json:"optional"`
	Required []string `json:"required"`
}
type Payer struct {
	Optional []string `json:"optional"`
	Required []string `json:"required"`
}

type SelectOptionBankAcctType struct {
	Code  string `json:"code"`
	Value string `json:"value"`
}
type PayerType struct {
	Code  string `json:"code"`
	Value string `json:"value"`
}
type PayeeProvince struct {
	Code string `json:"code"`
}
type SourceFund struct {
	Code string `json:"code"`
}
type PayeeAcctType struct {
	Code string `json:"code"`
}
type SelectOption struct {
	PayeeAcctType            []PayeeAcctType            `json:"payeeAcctType"`
	SelectOptionBankAcctType []SelectOptionBankAcctType `json:"bankAcctType"`
	PayerType                []PayerType                `json:"payerType"`
	PayeeProvince            []PayeeProvince            `json:"payeeProvince"`
	SourceFund               []SourceFund               `json:"sourceFund"`
}

type AutoGenerated struct {
	BankList     []string     `json:"bankList"`
	Condition    Condition    `json:"condition"`
	Payee        Payee        `json:"payee"`
	Payer        Payer        `json:"payer"`
	SelectOption SelectOption `json:"selectOption"`
}

type Tp1021Req struct {
	Country                    string `json:"country"`
	BankAcctNo                 string `json:"bankAcctNo"`
	PayeeType                  string `json:"payeeType"`
	Mobile                     string `json:"mobile"`
	BankCode                   string `json:"bankCode"`
	BranchName                 string `json:"branchName"`
	SubjectType                string `json:"subjectType"`
	CertNo                     string `json:"certNo"`
	PayeeName                  string `json:"payeeName"`
	Currency                   string `json:"currency"`
	BusinessType               string `json:"businessType"`
	SupplementaryMaterialsPath string `json:"supplementaryMaterialsPath"`
	BusinessLicensePath        string `json:"businessLicensePath"`
	FrontCardPath              string `json:"frontCardPath"`
	BackCardPath               string `json:"backCardPath"`
	LegalFrontCardPath         string `json:"legalFrontCardPath"`
	LegalBackCardPath          string `json:"legalBackCardPath"`
	LegalCertNo                string `json:"legalCertNo"`
}

type Tp1021Info struct {
	Code    string      `json:"code"`
	Message interface{} `json:"message"`
	BizFlow string      `json:"bizFlow"`
	Status  string      `json:"status"`
	Succ    bool        `json:"succ"`
}

type Tp1021Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1021Info `json:"body"`
}

type Tp1022Req struct {
	BizFlow                    string `json:"bizFlow"`
	Country                    string `json:"country"`
	BankAcctNo                 string `json:"bankAcctNo"`
	PayeeType                  string `json:"payeeType"`
	Mobile                     string `json:"mobile"`
	BranchName                 string `json:"branchName"`
	SubjectType                string `json:"subjectType"`
	CertNo                     string `json:"certNo"`
	PayeeName                  string `json:"payeeName"`
	Currency                   string `json:"currency"`
	BankCode                   string `json:"bankCode"`
	BusinessType               string `json:"businessType"`
	SupplementaryMaterialsPath string `json:"supplementaryMaterialsPath"`
	BusinessLicensePath        string `json:"businessLicensePath"`
	FrontCardPath              string `json:"frontCardPath"`
	BackCardPath               string `json:"backCardPath"`
	LegalFrontCardPath         string `json:"legalFrontCardPath"`
	LegalBackCardPath          string `json:"legalBackCardPath"`
	LegalCertNo                string `json:"legalCertNo"`
}

type Tp1022Info struct {
	Code    string      `json:"code"`
	Message interface{} `json:"message"`
	BizFlow interface{} `json:"bizFlow"`
	Status  interface{} `json:"status"`
}

type Tp1022Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1022Info `json:"body"`
}

type Tp1023Req struct {
	BizFlow string `json:"bizFlow"`
}

type Tp1023Info struct {
	Code string `json:"code"`
}

type Tp1023Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1023Info `json:"body"`
}

type Tp3004Req struct {
	Currency string `json:"currency"`
}

type Tp3004InfoList struct {
	Tp3004Info []Tp3004Info `json:"list"`
}

type Tp3004Info struct {
	Currency string `json:"currency"`
	Balance  string `json:"balance"`
	Status   string `json:"status"`
}

type Tp3004Res struct {
	Head           HeadStr        `json:"head"`
	Tp3004InfoList Tp3004InfoList `json:"body"`
}

type Tp1002Req struct {
	Amount        string `json:"amount" binding:"required"`
	BuyCurrency   string `json:"buyCurrency" binding:"required"`
	LockDirection string `json:"lockDirection" binding:"required"`
	MerOrderNo    string `json:"merOrderNo"`
	SellCurrency  string `json:"sellCurrency" binding:"required"`
}

func (req Tp1002Req) GetMessage() validator.ValidatorMessages {
	return validator.ValidatorMessages{
		"Amount.required":        "Amount不能为空",
		"BuyCurrency.required":   "BuyCurrency不能为空",
		"LockDirection.required": "LockDirection不能为空",
		"SellCurrency.required":  "SellCurrency不能为空",
	}
}

type Tp1002Info struct {
	BuyAmount    string `json:"buyAmount"`
	BuyCurrency  string `json:"buyCurrency"`
	ExpireTime   int64  `json:"expireTime"`
	MerOrderNo   string `json:"merOrderNo"`
	QuoteId      int64  `json:"quoteId"`
	Rate         string `json:"rate"`
	SellAmount   string `json:"sellAmount"`
	SellCurrency string `json:"sellCurrency"`
}
type Tp1002Infos struct {
	BuyAmount    string `json:"buyAmount"`
	BuyCurrency  string `json:"buyCurrency"`
	ExpireTime   int64  `json:"expireTime"`
	MerOrderNo   string `json:"merOrderNo"`
	QuoteId      string `json:"quoteId"`
	Rate         string `json:"rate"`
	SellAmount   string `json:"sellAmount"`
	SellCurrency string `json:"sellCurrency"`
}

type Tp1002Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1002Info `json:"body"`
}

type Tp1002ApiRes struct {
	Head HeadStr     `json:"head"`
	Body Tp1002Infos `json:"body"`
}

type Tp1003Req struct {
	CallbackUrl string `json:"callbackUrl"`
	QuoteId     string `json:"quoteId"`
}

type Tp1003Info struct {
	BizFlow      string `json:"bizFlow"`
	BuyAmount    string `json:"buyAmount"`
	BuyCurrency  string `json:"buyCurrency"`
	Code         string `json:"code"`
	Message      string `json:"message"`
	QuoteId      int64  `json:"quoteId"`
	Rate         string `json:"rate"`
	SellAmount   string `json:"sellAmount"`
	SellCurrency string `json:"sellCurrency"`
}

type Tp1003Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1003Info `json:"body"`
}

type Tp1004Req struct {
	AccountType    string `json:"accountType"`
	DebitAmount    string `json:"debitAmount"`
	ArriveCurrency string `json:"arriveCurrency"`
	CountryCode    string `json:"countryCode"`
	DebitCurrency  string `json:"debitCurrency"`
	MerOrderNo     string `json:"merOrderNo"`
	PayType        string `json:"payType"`
	Payee          struct {
		PayeeFirstName       string `json:"payeeFirstName"`
		PayeeLastName        string `json:"payeeLastName"`
		PayeeCity            string `json:"payeeCity"`
		PayeeProvince        string `json:"payeeProvince"`
		PayeeIdNo            string `json:"payeeIdNo"`
		PayeeEmail           string `json:"payeeEmail"`
		PayeePhone           string `json:"payeePhone"`
		PayeeAddress         string `json:"payeeAddress"`
		PayeeZipCode         string `json:"payeeZipCode"`
		PayeeAcctType        string `json:"payeeAcctType"`
		PayeeBankName        string `json:"payeeBankName"`
		PayeeBankAccountNo   string `json:"payeeBankAccountNo"`
		PayeeBankAddress     string `json:"payeeBankAddress"`
		PayeeResidentNo      string `json:"payeeResidentNo"`
		PayeeResidentCountry string `json:"payeeResidentCountry"`
		PayeeBankSwift       string `json:"payeeBankSwift"`
		PayeeCompanyName     string `json:"payeeCompanyName"`
		PayeeCountryCode     string `json:"payeeCountryCode"`
		ArriverCurrency      string `json:"arriverCurrency"`
		PayType              string `json:"payType"`
		BankAcctType         string `json:"bankAcctType"`
		PayeeBankBranchCode  string `json:"payeeBankBranchCode"`
	} `json:"payee"`
	Payer struct {
		PayerCity              string `json:"payerCity"`
		PayerType              string `json:"payerType"`
		PayerPhone             string `json:"payerPhone"`
		PayerAddress           string `json:"payerAddress"`
		PayerCountry           string `json:"payerCountry"`
		EndSenderName          string `json:"endSenderName"`
		PayerBankName          string `json:"payerBankName"`
		PayerProvince          string `json:"payerProvince"`
		PayerPostalCode        string `json:"payerPostalCode"`
		PayerCompanyName       string `json:"payerCompanyName"`
		PayerCompanyRegisterNo string `json:"payerCompanyRegisterNo"`
		PayerIncorporationDate string `json:"payerIncorporationDate"`
		PayerRegisteredCountry string `json:"payerRegisteredCountry"`
	} `json:"payer"`
	Purpose       string `json:"purpose"`
	PurposeRemark string `json:"purposeRemark"`
}

type Tp1004Info struct {
	ArriveAmount   string `json:"arriveAmount"`
	ArriveCurrency string `json:"arriveCurrency"`
	DebitAmount    string `json:"debitAmount"`
	DebitCurrency  string `json:"debitCurrency"`
	ExpireTime     int64  `json:"expireTime"`
	MerOrderNo     string `json:"merOrderNo"`
	QuoteId        int64  `json:"quoteId"`
	Rate           string `json:"rate"`
}

type Tp1004Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1004Info `json:"body"`
}

type Tp1005Req struct {
	CallbackUrl string `json:"callbackUrl"`
	QuoteId     string `json:"quoteId"`
}

type Tp1005Info struct {
	AccountType    string `json:"accountType"`
	ArriveAmount   string `json:"arriveAmount"`
	ArriveCurrency string `json:"arriveCurrency"`
	BizFlow        string `json:"bizFlow"`
	CountryCode    string `json:"countryCode"`
	DebitAmount    string `json:"debitAmount"`
	DebitCurrency  string `json:"debitCurrency"`
	MerOrderNo     string `json:"merOrderNo"`
	PayType        string `json:"payType"`
	QuoteId        int64  `json:"quoteId"`
	Rate           string `json:"rate"`
	Status         string `json:"status"`
	Code           string `json:"code"`
	Message        string `json:"message"`
	FixBizFlow     string `json:"fixBizFlow"`
}

type Tp1005Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1005Info `json:"body"`
}

type PayOrderList struct {
	DebitAmount           int64  `json:"debitAmount"`
	CNAPSCode             string `json:"cNAPSCode"`
	DeclarationCurrency   string `json:"declarationCurrency"`
	DebitCurrency         string `json:"debitCurrency"`
	Identity              string `json:"identity"`
	MerSingleNo           string `json:"merSingleNo"`
	Mobile                string `json:"mobile"`
	PayMethod             string `json:"payMethod"`
	PayeeAccountNo        string `json:"payeeAccountNo"`
	PayeeName             string `json:"payeeName"`
	RegistrationRegion    string `json:"registrationRegion"`
	SenderIncorporationNo string `json:"senderIncorporationNo"`
	TradeCodeType         string `json:"tradeCodeType"`
	SenderName            string `json:"senderName"`
	SenderBankName        string `json:"senderBankName"`
}

type PayReduceList struct {
	GoodNumber    string `json:"goodNumber"`
	GoodsName     string `json:"goodsName"`
	OrderAmount   int64  `json:"orderAmount"`
	OrderCurrency string `json:"orderCurrency"`
	OrderDate     string `json:"orderDate"`
	OrderNo       string `json:"orderNo"`
	PlatformName  string `json:"platformName"`
	Purpose       string `json:"purpose"`
	StoreLink     string `json:"storeLink"`
	WlName        string `json:"wlName"`
	WlSeqno       string `json:"wlSeqno"`
	PayeeAcctNo   string `json:"payeeAcctNo"`
	SellerName    string `json:"sellerName"`
	SellerId      string `json:"sellerId"`
	GoodsCategory string `json:"goodsCategory"`
}

type Tp1001Req struct {
	CallbackUrl    string          `json:"callbackUrl"`
	FileUrlPath    string          `json:"fileUrlPath"`
	MerOrderNo     string          `json:"merOrderNo"`
	PayOrderList   []PayOrderList  `json:"payOrderList"`
	PayReduceList  []PayReduceList `json:"payReduceList"`
	PaymentType    string          `json:"paymentType"`
	SettlementType string          `json:"settlementType"`
}

type Tp1001Info struct {
	Status          string  `json:"status"`
	BizFlowNo       string  `json:"bizFlowNo"`
	MerOrderNo      string  `json:"merOrderNo"`
	FeeCurrency     string  `json:"feeCurrency"`
	FeeAmount       float64 `json:"feeAmount"`
	ActualPayAmount float64 `json:"actualPayAmount"`
	DebitCurrency   string  `json:"debitCurrency"`
	Rate            float64 `json:"rate"`
	DebitAmount     float64 `json:"debitAmount"`
	Amount          float64 `json:"amount"`
	QuoteId         int64   `json:"quoteId"`
}

type Tp1001Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1001Info `json:"body"`
}

type Tp1019Req struct {
	QuoteId string `json:"quoteId"`
}

type Tp1019Info struct {
	Amount          float64 `json:"amount"`
	BizFlowNo       string  `json:"bizFlowNo"`
	DebitAmount     float64 `json:"debitAmount"`
	DebitCurrency   string  `json:"debitCurrency"`
	ExpireTime      int64   `json:"expireTime"`
	MerOrderNo      string  `json:"merOrderNo"`
	QuoteId         int64   `json:"quoteId"`
	Rate            float64 `json:"rate"`
	Status          string  `json:"status"`
	FeeAmount       float64 `json:"feeAmount"`
	FeeCurrency     string  `json:"feeCurrency"`
	ActualPayAmount float64 `json:"actualPayAmount"`
}

type Tp1019Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1019Info `json:"body"`
}

type GoodsList struct {
	OrderName string `json:"orderName"`
	OrderNum  string `json:"orderNum"`
}

type Tp1012Req struct {
	Amount          int             `json:"amount"`
	BuyerArea       string          `json:"buyerArea"`
	BuyerName       string          `json:"buyerName"`
	CallbackUrl     string          `json:"callbackUrl"`
	Currency        string          `json:"currency"`
	GoodsList       []GoodsList     `json:"goodsList"`
	LogCompany      string          `json:"logCompany"`
	LogNo           string          `json:"logNo"`
	LogStatus       string          `json:"logStatus"`
	MerOrderNo      string          `json:"merOrderNo"`
	ServiceTrade    ServiceTradeObj `json:"serviceTrade"`
	TradeType       string          `json:"tradeType"`
	TranscationCert []string        `json:"transcationCert"`
	TranscationDate string          `json:"transcationDate"`
	AnnexUrl        []string        `json:"annexUrl"`
}

type ServiceTradeObj struct {
	ServiceCondition string   `json:"serviceCondition"` // 服务贸易完成状态 0-未完成 1-已完成
	ProveUrl         []string `json:"proveUrl"`         // 当服务贸易状态为1 此项必填
	ConditionDate    string   `json:"conditionDate"`    // 当服务贸易状态为0 此项必填 格式 yyyy-MM-dd
}

type Tp1012Info struct {
	ContractNo string `json:"contractNo"`
}

type Tp1012Res struct {
	Head HeadStr    `json:"head"`
	Body Tp1012Info `json:"body"`
}
type Tp6001Req struct {
	PageNo   int `json:"pageNo"`
	PageSize int `json:"pageSize"`
}

type Tp6001Info struct {
	PageNo   int `json:"pageNo"`
	PageSize int `json:"pageSize"`
	Results  []struct {
		BankId     int    `json:"bankId"`
		BankLinkNo string `json:"bankLinkNo"`
		BankName   string `json:"bankName"`
	} `json:"results"`
	TotalPage   int `json:"totalPage"`
	TotalRecord int `json:"totalRecord"`
}

type Tp6001Res struct {
	Head HeadStr    `json:"head"`
	Body Tp6001Info `json:"body"`
}

type Tp6002Req struct {
	BankId string `json:"bankId"`
}

type Tp6002Info struct {
	BankId       int `json:"bankId"`
	ProvinceList []struct {
		ProvinceCode   string `json:"provinceCode"`
		ProvinceName   string `json:"provinceName"`
		ProvinceNameEn string `json:"provinceNameEn"`
	} `json:"provinceList"`
}

type Tp6002Res struct {
	Head HeadStr    `json:"head"`
	Body Tp6002Info `json:"body"`
}

type Tp6003Req struct {
	BankId       string `json:"bankId"`
	ProvinceCode string `json:"provinceCode"`
}

type Tp6003Info struct {
	BankId   int `json:"bankId"`
	CityList []struct {
		CityCode   string `json:"cityCode"`
		CityName   string `json:"cityName"`
		CityNameEn string `json:"cityNameEn"`
	} `json:"cityList"`
	ProvinceCode string `json:"provinceCode"`
}

type Tp6003Res struct {
	Head HeadStr    `json:"head"`
	Body Tp6003Info `json:"body"`
}

type Tp6004Request struct {
	BankId   int    `json:"bankId"`
	CityCode string `json:"cityCode"`
}

type Tp6004Req struct {
	PageNo   int           `json:"pageNo"`
	PageSize int           `json:"pageSize"`
	Request  Tp6004Request `json:"request"`
}

type Tp6004Info struct {
	PageNo   int `json:"pageNo"`
	PageSize int `json:"pageSize"`
	Results  []struct {
		BankCityCode       string `json:"bankCityCode"`
		BankCityName       string `json:"bankCityName"`
		BankCityNameEn     string `json:"bankCityNameEn"`
		BankLinkNo         string `json:"bankLinkNo"`
		BankName           string `json:"bankName"`
		BankNameEn         string `json:"bankNameEn"`
		BankProvinceCode   string `json:"bankProvinceCode"`
		BankProvinceName   string `json:"bankProvinceName"`
		BankProvinceNameEn string `json:"bankProvinceNameEn"`
	} `json:"results"`
	TotalPage   int `json:"totalPage"`
	TotalRecord int `json:"totalRecord"`
}

type Tp6004Res struct {
	Head HeadStr    `json:"head"`
	Body Tp6004Info `json:"body"`
}

type TestTp1001Req struct {
	Amount         string `json:"amount"`
	BankAccountNo  string `json:"bankAccountNo"`
	BankIncomeTime string `json:"bankIncomeTime"`
	Currency       string `json:"currency"`
	PayerName      string `json:"payerName"`
}

type TestTp1002Req struct {
	Amount         string `json:"amount"`
	BankIncomeTime string `json:"bankIncomeTime"`
	Currency       string `json:"currency"`
}

type Tp1014Req struct {
	TradeCode   string `json:"tradeCode"`
	CallbackUrl string `json:"callbackUrl"`
}

type Tp3013Req struct {
	MerOrderNo string `json:"merOrderNo"`
}

type Tp3013Info struct {
	ContractList []ContractListInfo `json:"contractList"`
}

type ContractListInfo struct {
	Amount          float64         `json:"amount"`
	AnnexUrl        []string        `json:"annexUrl"`
	BuyerArea       string          `json:"buyerArea"`
	BuyerName       string          `json:"buyerName"`
	CallbackUrl     string          `json:"callbackUrl"`
	ContractNo      string          `json:"contractNo"`
	Currency        string          `json:"currency"`
	GoodsList       []GoodsList     `json:"goodList"`
	LogCompany      string          `json:"logCompany"`
	LogNo           string          `json:"logNo"`
	LogStatus       string          `json:"logStatus"`
	MerOrderNo      string          `json:"merOrderNo"`
	Message         string          `json:"message"`
	ServiceTrade    ServiceTradeObj `json:"serviceTrade"`
	Status          string          `json:"status"`
	TradeType       string          `json:"tradeType"`
	TranscationCert []string        `json:"transcationCert"`
	TranscationDate string          `json:"transcationDate"`
}

type Tp3013Res struct {
	Head HeadStr    `json:"head"`
	Body Tp3013Info `json:"body"`
}
